package com.fashiontextile.designer.mapper;

import com.fashiontextile.user.entity.Comment;
import com.fashiontextile.user.entity.Image;
import com.fashiontextile.designer.entity.Designer;
import com.fashiontextile.designer.entity.DesignerWorks;
import com.fashiontextile.designer.entity.WorksAlbum;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DesignerMapper {
    Integer insertDesigner(Designer designer);

    Integer updateDesignerInfo(@Param("designerInfo") Designer newdesignerInfo, @Param("uid") long uid);

    Long getFdidByUid(long uid);

    Integer addAlbum(WorksAlbum worksAlbum);

    Integer updateAlbum(WorksAlbum worksAlbum);

    boolean isExistAlbum(long waid);

    Integer updataAlbumState(long waid);

    Integer addDesignerWork(DesignerWorks designerWorks);

    boolean isExistWorks(long dwid);

    Integer updateWorksByDwid(@Param("works") DesignerWorks designerWorks, @Param("dwid") long dwid);

    Integer updataWorksState(long dwid);

    Designer selectDesignerByid(long fdid);

    List<WorksAlbum> getAllAlbumByFdid(long fdid);

    WorksAlbum getAlbumAndWorks(long waid);

    DesignerWorks getWorksByDwid(long dwid);

    Designer getDesignerByUid(long uid);

    List<Image> selectImage(@Param("diid") Long imageTypeId, @Param("pointTo") Long pointTo);

    List<Image> selectImages(@Param("diid") Long imageTypeId, @Param("pointTos") List<Long> pointTos);

    List<Designer> getRandDesigner(Integer num);

    List<Designer> getNewestDesigner(Integer num);

    List<DesignerWorks> getNewWorksS();

    List<DesignerWorks> getRandomWorksS();

    Integer CommentWorks(Comment comment);

    List<Comment> selectAllParantComment(Long ctid);

    List<Comment> selectAllChildrenComment(Long ctid);

    long selectOldPopularity(Long dwid);

    Integer updatePopularity(@Param("dwid") Long dwid,@Param("popularity") Long popularity);
}
